package com.kongwg.java;

import org.junit.Test;

import java.util.List;

/**
 * @author kongwg
 * @create 2020-12-17 11:21
 */
public class GenericTest1 {

    @Test
    public void test(){
        Order o = new Order();
        o.getOrderT();
    }
    @Test
    public void test1(){
        Order<String> stringOrder = new Order<>();

        stringOrder.getOrderT();
    }

    @Test
    public void test2(){
        subOrderTest1 subOrderTest1 = new subOrderTest1();
        subOrderTest1.getOrderT();

        subOrderTest2<String> stringsubOrderTest2 = new subOrderTest2<>();
        stringsubOrderTest2.getOrderT();
    }



    //测试泛型方法
    @Test
    public void test3(){
        Order<String> order = new Order<>();

        Integer[] i = new Integer[]{1,2,3,4};

        List<Integer> integers = order.copyFormArray(i);
        System.out.println(integers);

        List<Integer> integers1 = Order.copyFormArray(i);
        System.out.println(integers1);

    }
}
